package net.wofly.sale.order.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import net.wofly.sale.order.repository.ReturnGiftRepository;
import net.wofly.sale.order.domain.ReturnGift;
import net.wofly.sale.order.service.IReturnGiftService;

@Service("iReturnGiftService")
@Transactional
public class ReturnGiftServiceImpl implements IReturnGiftService {

	@Autowired
	ReturnGiftRepository returnGiftRepository;

	@Override
	public ReturnGift save(ReturnGift entity) {
		return returnGiftRepository.save(entity);
	}

	@Override
	public void delete(ReturnGift entity) {
		returnGiftRepository.delete(entity);
	}

	@Override
	public void delete(String key) {
		returnGiftRepository.delete(key);
	}
	
	@Override
	public void deleteByReturnSalesID(String returnSalesID) {
		returnGiftRepository.deleteByReturnSalesID(returnSalesID);
	}
	
	@Override
	public ReturnGift findOne(String key) {
		return returnGiftRepository.findOne(key);
	}
	
	@Override
	public List<ReturnGift> findByReturnSalesID(String returnSalesID) {
		return returnGiftRepository.findByReturnSalesID(returnSalesID);
	}
	
	@Override
	public List<ReturnGift> save(List<ReturnGift> entityList) {
		return (List<ReturnGift>) returnGiftRepository.save(entityList);
	}
}
